<?php

namespace App\Http\Controllers\Mobile;

use App\Model\Workflow_desc;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;

//排班确认
class SchedulController extends CommonController
{
    //


	protected static $uid;
	protected $Workflow_desc;
	public function __construct()
	{
		parent::__construct();
		self::$uid=Auth::user()->id;
		$this->Workflow_desc=new Workflow_desc();
	}

//	排班确认首页
	public function index()
	{
//		查询该用户的审批业务组
		$data=$this->Workflow_desc->Scheduling_lists(self::$uid);
		$newArr=[];
		$newArr['stay_trial']=[];
		$newArr['rial']=[];

		foreach($data as $kk=>$vv){
			if($vv['status']==1){
				$newArr['stay_trial'][]=$vv;
			}else{
				$newArr['rial'][]=$vv;
				foreach($newArr['rial'] as $key=>$value){
					$newArr['rial'][$key]['statu']=$value['settlement']['status']==2?'已同意':'不通过';
				}
			}
		}


		return $this->success($newArr);
	}


//	排班审批详情
	public function Sch_desc(){
		return 111;
	}
}
